package com.junzhiit.nengji.cms.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.junzhiit.nengji.cms.service.AreaService;
import com.junzhiit.nengji.cms.web.vo.AreaVO;
import com.junzhiit.nengji.cms.web.vo.ResultVO;
import com.junzhiit.nengji.model.Area;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("area")
public class AreaController extends BaseController {

	@Autowired
	private AreaService areaService;
	
	@RequestMapping(value="/info",method=RequestMethod.GET)
	public ResultVO findInfo(AreaVO areaVO){
		return areaService.findInfo(areaVO);
	}
	
	@ApiOperation(value = "更新area表的initial字段(不常用)")
	@RequestMapping(value="/update/initial",method=RequestMethod.POST)
	public ResultVO update(Area area){
		return areaService.updateInitial(area);
	}
	
	@ApiOperation(value = "获取所有信息")
	@RequestMapping(method=RequestMethod.GET)
	public ResultVO findAll(){
		return areaService.findAll();
	}
}
